import request from '@/utils/request'

const api_name = "/admin/el/userPaper"

export default {   
    //根据用户来创建试卷
    CreatPaperToUser(paperId){
        return request({
            url:`${api_name}/${paperId}`, 
            method: 'get',
        })
    },

    //用el_user_paper_id来获取题目信息，返回给页面
    InitQu(elUserPaperId){
        return request({
            url:`${api_name}/init/${elUserPaperId}`, 
            method: 'get',
        })
    },

    //获取单个题目(实在是没有办法了呜呜呜) (废弃，并没有用到)
    GetOneQu(elUserPaperId,quId){
        return request({
            url:`${api_name}/${elUserPaperId}/${quId}`, 
            method: 'get',
        })
    },
    //交卷操作(批量更新)
    InsertList(list,paperId,elUserPaperId){
        return request({
            url:`${api_name}/${paperId}/${elUserPaperId}`, 
            method: 'put',
            data: list
        })
    },
    //获取我写过的卷子
    Mywork(page,limit,searchObj){
        return request({
            url:`${api_name}/Mywork/${page}/${limit}`, 
            method: 'get',
            params: searchObj
        })
    },

    //根据某个作业id来获取所有写这个卷子的人
    workDetail(page,limit,paperId,searchObj){
        return request({
            url:`${api_name}/workDetail/${page}/${limit}/${paperId}`, 
            method: 'get',
            params: searchObj
        })
    },

    //刷新分数
    UpdatePoint(elUserPaperId){
        return request({
            url:`${api_name}/UpdatePoint/${elUserPaperId}`, 
            method: 'get',
        })
    },
    //打分
    updateGetPoint(elUserPaperId,point){
        return request({
            url:`${api_name}/updateGetPoint/${elUserPaperId}/${point}`, 
            method: 'put',
        })
    }


    
}